import request from '../utils/request';
// import host from '../components/settings'
import host from '../../settings'
export const fetchData = query => {
    return request({
        url: host.HOST + query.action,
        method: 'get',
        params: query
    });
}

export const load_iap_list = query => {
  return request({
    url: host.HOST + "/loadIapList",
    method: 'get',
  })
}

export function iapItemList() {
  return request({
    url: host.HOST + '/load_iap_list',
    method: 'get'
  })
}

// 20220615 @locus
export const fetchList = query => {
  return request({
    url: host.HOST + '/' + query.action,
    method: 'post',
    data: query
  })
}
export const GetCheckTagsList = async event_type => {
  return request({
    url: host.HOST + '/get_check_tags_list',
    method: 'post',
    data: {
      event_type: event_type
    }
  });
}

export const GetPartEventConfig = query => {
    return request({
      url: host.HOST + '/get_part_event_config',
      method: 'get',
      params: query
    });
}


export const GetRewardIdentifier = query => {
    let data = {
        "project": "westgame",
        "environment": "dev",
        "label_style": "classic",
        "part": ["reward_type_list", "reward_list"]
    }
    let postUrl = 'http://54.223.156.94:3547/get_reward'
    return request({
        url: postUrl,
        method: 'post',
        data: {...data,...query}
    });
}
